// 方法1
// type MyReadonly2<T, K extends keyof T = keyof T> = {
//   readonly [P in K]: T[P];
// } & Omit<T, K>;

// 方法2
type MyReadonly2<T, K extends keyof T = keyof T> = {
  readonly [P in K]: T[P];
} & {
  [P in keyof T as P extends K ? never : P]: T[P];
};

interface Todo1 {
  title: string;
  description?: string;
  completed: boolean;
}

type R2 = MyReadonly2<Todo1>;
